package com.zlx.xbhy.mapper;

import com.zlx.xbhy.entity.Dept;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * @ClassName DeptMapper
 * @Description TODO
 * @Author Edward
 * @Date 2020/11/19 20:24
 */
public interface DeptMapper extends Mapper<Dept> {
    @Select("SELECT " +
            "d.id, " +
            "d.`name`, " +
            "COUNT( d.id ) count  " +
            "FROM " +
            "`user` u " +
            "INNER JOIN dept d ON u.dept_id = d.id  " +
            "GROUP BY " +
            "d.id")
    public List<Dept> ListDept();
}
